﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wpf.Activation.Demo2
{
    public class LicenseValidator
    {
        public static bool ValidateLicenseKey(string licenseKey, DateTime now, TimeSpan duration)
        {
            // 解析授权密钥
            // 这里简化为直接比较解析出的日期和时长
            var expectedKey = LicenseGenerator.GenerateLicenseKey(now, duration);
            return licenseKey == expectedKey;
        }
    }
}
